//连接数据库
module.exports = app => {
    const mongoose = require('mongoose')
    mongoose.connect('mongodb://localhost:27017/admin',{
        useNewUrlParser: true, //当前的URL字符串解析器被弃用的解决方案 
        useUnifiedTopology: true,
        useFindAndModify: false
    })
    mongoose.connection.once('open', function(){
        console.log('mongoose成功启动');
    })
} 